import { http } from '@/utils/http'
import { http1 } from '@/utils/http'
import type { mylogin } from '@/types/my'
export const shoyeAPI = (user) => {
  console.log('首页发送了请求')

  // 首页请求
  return http1<any>({
    method: 'GET',
    url: `/shoye`,
  })
}
export const shoyefeiyeAPI = (user) => {
  console.log('首页具体发送了请求')

  // 首页具体请求
  return http1<any>({
    method: 'GET',
    url: `/shoye?uid=${user.uid}`,
  })
}

export const searchAPI = (user) => {
  console.log('搜索发送了请求')

  // 搜索请求
  return http1<any>({
    method: 'POST',
    url: `/search`,
    data: user,
  })
}

// 轮播图
export const getBannerAPI = (name = '1') => {
  console.log('轮播图发送了请求')

  // 轮播图请求   getPic/gaozhong
  // /getPic/xiaoxue
  return http1<any>({
    method: 'POST',
    url: `/api/getPic`,
    data: { name },
  })
}
// 分类
export const getCategoryAPI = () => {
  console.log('分类发送了请求')

  // 分类请求
  return http1<any>({
    method: 'GET',
    url: `/api/getCategoryAPI`,
  })
}
// 获取列表数据
export const getListAPI = (user) => {
  console.log('列表发送了请求')

  // 列表请求
  return http1<any>({
    method: 'POST',
    url: `/list`,
    data: user,
  })
}

export const getchoutiAPI = () => {
  console.log('详情发送了请求')

  // 详情请求
  return http<any>({
    method: 'GET',
    url: `/chouti`,
  })
}

// 获取话题数据
export const getTopicListAPI = () => {
  return http1<any>({
    method: 'GET',
    url: '/api/getTopicListAPI',
  })
}
// 抽屉数据
export const getDrawerAPI = () => {
  return http1<any>({
    method: 'GET',
    url: '/api/getDrawerAPI',
  })
}
// 获取话题详情
export const getTopicDetailAPI = (obj) => {
  return http1<any>({
    method: 'post',
    url: `/api/getTopicDetailAPI`,
    data: obj,
  })
}

// 获取古诗
export const getgusAPI = (obj) => {
  return http1<any>({
    method: 'POST',
    url: `/api/getgusAPI`,
    data: {nianji:obj},
  })
}
